function quickSort(array) {
  if(array.length < 2) {
    return array;
  }
  // 选择一个哨兵，选择数组第一个
  let cur = array[0];
  let left = array.filter((item, index) => item <= cur && index > 0);
  let right = array.filter(item => item > cur);
  return [].concat(quickSort(left)).concat(cur).concat(quickSort(right))
}

console.log(quickSort([5,2,4,3,1,0,7, 1, 2,10]));